package interview;

import java.util.*;

public class Main {
    static class pro{
        String s;
        int i;
        public pro(String s, int i) {
            this.s = s;
            this.i = i;
        }
    }
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String[] input = sc.nextLine().split(" ");
        int[] nums = new int[input.length];
        for(int i = 0; i < input.length; i++){
            char[] ch = input[i].toCharArray();
            for(int j = 0; j < ch.length; j++){
                if(ch[j] <= '9' && ch[j] >= '1')
                    nums[i] = ch[j] - '0';

            }
        }
        pro[] p = new pro[input.length];
        for(int i = 0; i < input.length; i++){
            p[i] = new pro(input[i], nums[i]);
        }
        Arrays.sort(p, Comparator.comparingInt(a -> a.i));
        for(int i = 0; i < input.length; i++){
            if(i != input.length - 1)
            System.out.print(p[i].s + " ");
            else
                System.out.print(p[i].s);
        }
    }
}
/*
is2 Thi1s T4est 3a
 */